import styles from "./index.module.scss"
import {MutableRefObject, useRef} from "react";


export function PrButton(props: any) {
    const {children = ""} = props
    return <button className={styles.prButton}>
        {children}
    </button>
}


const AnimatedButton = ({onClick, children}: any) => {
    const buttonRef = useRef<any>(null);

    const handleClick = () => {
        if (onClick) {
            onClick();
        }
        if (!buttonRef.current) return

        // // Remove the active class to reset the animation
        // buttonRef.current.classList.remove(styles.active);
        //
        // // Force a reflow to ensure the animation starts again
        // void buttonRef.current.offsetWidth;
        //
        // // Add the active class to trigger the animation
        // buttonRef.current.classList.add(styles.active);
    };

    return (
        <button ref={buttonRef} className={styles.button} onClick={handleClick}>
            {children}
        </button>
    );
};

export default AnimatedButton;
